include_rules = [
  "+apps",
  "+cc/input/browser_controls_offset_tags_info.h",
  "+cc/input/browser_controls_state.h",
  "+cc/input/android/java",
  "+cc/input/android/offset_tag_android.h",
  "+cc/metrics",
  "+cc/paint",
  "+cc/test",

  # Restricting uses of Chrome*Activity in favor of direct dependency aquisition. Code that lives
  # under java/src/.../chrome/browser has a seperate exception under that same directory.
  # Exceptions can be found under "specific_include_rules" below.
  "-chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java",
  "-chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java",
  "-chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity2.java",

  "+chrome/android/native_j_unittests_jni_headers",
  "+chrome/android/chrome_jni_headers",
  "+chrome/android/features/dev_ui",
  "+chrome/android/modules",
  "+chrome/android/test_support_jni_headers",
  "+chrome/app",
  "+chrome/credential_provider/common",
  "+chrome/grit",
  "+chrome/install_static",
  "+chrome/installer/util",
  "+chrome/notification_helper/notification_helper_constants.h",
  "+chrome/services/cups_proxy",
  "+chrome/services/diagnosticsd/public",
  "+chrome/services/file_util/public",
  "+chrome/services/mac_notifications/public",
  "+chrome/services/machine_learning/public",
  "+chrome/services/media_gallery_util/public",
  "+chrome/services/pdf/public",
  "+chrome/services/printing/public",
  "+chrome/services/sharing/public",
  "+chrome/services/removable_storage_writer/public",
  "+chrome/services/util_win/public",
  "+chrome/updater/app/server/win/updater_legacy_idl.h",
  "+chromeos",
  "+components/about_ui",
  "+components/access_code_cast",
  "+components/account_id",
  "+components/account_manager_core",
  "+components/affiliations",
  "+components/allocation_recorder",
  "+components/android_autofill/browser",
  "+components/app_constants/constants.h",
  "+components/app_launch_prefetch",
  "+components/app_restore",
  # TODO(b/129295708): Remove after move is complete.
  "+components/arc",
  "+components/assist_ranker",
  "+components/autofill/android",
  "+components/autofill/content/browser",
  "+components/autofill/content/common",
  "+components/autofill/core/browser",
  "+components/autofill/core/common",
  "+components/back_forward_cache",
  "+components/background_fetch",
  "+components/background_sync",
  "+components/background_task_scheduler",
  "+components/base32",
  "+components/blocked_content",
  "+components/blocklist/opt_out_blocklist",
  "+components/bookmarks/browser",
  "+components/bookmarks/common",
  "+components/bookmarks/managed",
  "+components/bookmarks/test",
  "+components/breadcrumbs/core",
  "+components/browser_sync",
  "+components/browser_ui/accessibility",
  "+components/browser_ui/bottomsheet",
  "+components/browser_ui/desktop_windowing/android",
  "+components/browser_ui/edge_to_edge",
  "+components/browser_ui/modaldialog",
  "+components/browser_ui/notifications",
  "+components/browser_ui/photo_picker",
  "+components/browser_ui/settings",
  "+components/browser_ui/util",
  "+components/browser_ui/widget",
  "+components/browser_ui/site_settings",
  "+components/browser_ui/strings",
  "+components/browser_ui/styles",
  "+components/browsing_data/content",
  "+components/cached_flags",
  "+components/continuous_search/common",
  "+components/continuous_search/browser",
  "+components/browsing_data/core",
  "+components/browsing_topics",
  "+components/custom_handlers",
  "+components/captive_portal",
  "+components/cast_channel",
  "+components/cbor",
  "+components/cdm/browser",
  "+components/certificate_matching",
  "+components/certificate_transparency",
  "+components/chromeos_camera",
  "+components/client_hints/browser",
  "+components/client_hints/common",
  "+components/cloud_devices/common",
  "+components/collaboration/public",
  "+components/color",
  "+components/commerce",
  "+components/component_updater",
  "+components/component_updater/installer_policies",
  "+components/compose",
  "+components/autofill_ai",
  "+components/consent_auditor",
  "+components/constrained_window",
  "+components/content_capture/browser",
  "+components/content_settings/browser",
  "+components/content_settings/core/browser",
  "+components/content_settings/core/test",
  "+components/contextual_search/buildflags.h",
  "+components/contextual_search/core/proto",
  "+components/contextual_search/core/browser",
  "+components/cookie_config",
  "+components/country_codes",
  "+components/crash/content/browser",
  "+components/crash/core/app",
  "+components/crash/core/browser",
  "+components/crash/core/common",
  "+components/creator",
  "+components/cross_device/nearby",
  "+components/crx_file",
  "+components/data_use_measurement/core",
  "+components/desks_storage",
  "+components/dbus",
  "+components/device_event_log",
  "+components/device_signals/core/browser",
  "+components/device_signals/core/common",
  "+components/content_relationship_verification",
  "+components/data_sharing/public",
  "+components/digital_goods",
  "+components/domain_reliability",
  "+components/dom_distiller/content/browser",
  "+components/dom_distiller/content/common",
  "+components/dom_distiller/core",
  "+components/dom_distiller/webui",
  "+components/download/content/factory",
  "+components/download/content/public",
  "+components/download/internal/background_service",
  "+components/download/network/android",
  "+components/download/public/background_service",
  "+components/download/public/common",
  "+components/download/public/task",
  "+components/drive",
  "+components/embedder_support",
  "+components/encrypted_messages",
  "+components/enterprise",
  "+components/error_page/content/browser",
  "+components/exo",
  "+components/external_intents",
  "+components/facilitated_payments/core/features",
  "+components/favicon_base",
  "+components/favicon/android",
  "+components/favicon/content",
  "+components/favicon/core",
  "+components/feature_engagement",
  "+components/federated_learning",
  "+components/feed",
  "+components/feedback",
  "+components/file_access",
  "+components/find_in_page",
  "+components/fingerprinting_protection_filter/browser",
  "+components/fingerprinting_protection_filter/common",
  "+components/fingerprinting_protection_filter/mojom",
  "+components/flags_ui",
  "+components/gcm_driver",
  "+components/global_media_controls",
  "+components/google/core/browser",
  "+components/google/core/common",
  "+components/grit",
  "+components/guest_view/buildflags",
  "+components/guest_view/browser",
  "+components/handoff",
  "+components/headless",
  "+components/heap_profiling",
  "+components/heavy_ad_intervention",
  "+components/history/content/browser",
  "+components/history/core/browser",
  "+components/history/core/common",
  "+components/history/core/test",
  "+components/history/metrics",
  "+components/image_fetcher/core",
  "+components/infobars/android",
  "+components/infobars/content",
  "+components/infobars/core",
  "+components/input",
  "+components/installedapp",
  "+components/invalidation",
  "+components/ip_protection",
  "+components/javascript_dialogs",
  "+components/keep_alive_registry",
  "+components/keyed_service/content",
  "+components/keyed_service/core",
  "+components/language/content/browser",
  "+components/language/core/browser",
  "+components/language/core/common",
  "+components/language/core/language_model",
  "+components/language_detection/core/browser",
  "+components/lens",
  "+components/leveldb_proto/content",
  "+components/leveldb_proto/public",
  "+components/leveldb_proto/testing",
  "+components/live_caption",
  "+components/local_state",
  "+components/location/android",
  "+components/lookalikes/core",
  "+components/login",
  "+components/media_device_salt",
  "+components/media_message_center",
  "+components/media_router/browser",
  "+components/history_clusters",
  "+components/history_clusters/history_clusters_internals",
  "+components/history_embeddings",
  "+components/manta",
  "+components/media_effects",
  "+components/memory_pressure",
  "+components/memory_system",
  "+components/messages/android",
  "+components/metal_util",
  "+components/metrics",
  "+components/metrics_services_manager",
  "+components/metrics/ui",
  "+components/mirroring/browser",
  "+components/mirroring/mojom",
  "+components/mirroring/service",
  "+components/module_installer/android",
  "+components/nacl/broker",
  "+components/nacl/browser",
  "+components/nacl/common",
  "+components/nacl/loader",
  "+components/navigation_interception",
  "+components/navigation_metrics",
  "+components/net_log",
  "+components/network_hints/common",
  "+components/network_session_configurator/browser",
  "+components/network_session_configurator/common",
  "+components/network_time",
  "+components/no_state_prefetch/browser",
  "+components/no_state_prefetch/common",
  "+components/ntp_tiles",
  "+components/offline_items_collection/core",
  "+components/offline_pages/buildflags",
  "+components/offline_pages/content",
  "+components/offline_pages/core",
  "+components/offline_pages/task",
  "+components/omnibox/browser",
  "+components/onc",
  "+components/open_from_clipboard",
  "+components/page_content_annotations/core",
  "+components/optimization_guide/content",
  "+components/optimization_guide",
  "+components/optimization_guide/optimization_guide_internals",
  "+components/origin_trials",
  "+components/os_crypt/async",
  "+components/os_crypt/sync",
  "+components/ownership",
  "+components/page_image_service",
  "+components/page_info",
  "+components/page_load_metrics/browser",
  "+components/page_load_metrics/common",
  "+components/page_load_metrics/google/browser",
  "+components/paint_preview/features",
  "+components/paint_preview/browser",
  "+components/paint_preview/buildflags",
  "+components/password_manager/content/browser",
  "+components/password_manager/content/common",
  "+components/password_manager/core/browser",
  "+components/password_manager/core/common",
  "+components/payments/content",
  "+components/payments/core",
  "+components/performance_manager/public",
  "+components/performance_manager/embedder",
  "+components/performance_manager/test_support",
  "+components/permissions",
  "+components/sampling_profiler",
  "+components/webid",
  "+components/pdf/browser",
  "+components/pdf/common",
  "+components/plus_addresses",
  "+components/policy",
  "+components/power_bookmarks",
  "+components/power_metrics",
  "+components/pref_registry",
  "+components/prefs",
  "+components/previews/content",
  "+components/previews/core",
  "+components/printing/browser",
  "+components/printing/common",
  "+components/privacy_sandbox",
  "+components/profile_metrics",
  "+components/proxy_config",
  "+components/qr_code_generator",
  "+components/query_parser",
  "+components/query_tiles",
  "+components/quirks",
  "+components/reading_list/core",
  "+components/reading_list/features",
  "+components/remote_cocoa/app_shim",
  "+components/remote_cocoa/browser",
  "+components/remote_cocoa/common",
  "+components/renderer_context_menu",
  "+components/reputation",
  "+components/reporting",
  "+components/rlz",
  "+components/safe_browsing/android",
  "+components/safe_browsing/buildflags.h",
  "+components/safe_browsing/content/browser",
  "+components/safe_browsing/content/common",
  "+components/safe_browsing/core/browser",
  "+components/safe_browsing/core/common",
  "+components/tpcd/metadata",
  "+components/tpcd/support",
  "+components/safe_search_api",
  "+components/saved_tab_groups/public",
  "+components/schema_org",
  "+components/shared_highlighting/core/common",
  "+components/search",
  "+components/search_engines",
  "+components/search_provider_logos",
  "+components/security_interstitials/content",
  "+components/security_interstitials/core",
  "+components/security_state/content",
  "+components/security_state/core",
  "+components/segmentation_platform/public",
  "+components/segmentation_platform/embedder",
  "+components/send_tab_to_self",
  "+components/sensitive_content",
  "+components/services/app_service/public",
  "+components/services/filesystem/public/mojom",
  "+components/services/heap_profiling",
  "+components/services/language_detection/public/cpp",
  "+components/services/language_detection/public/mojom",
  "+components/services/on_device_translation/buildflags",
  "+components/services/on_device_translation/public",
  "+components/services/paint_preview_compositor/public/mojom",
  "+components/services/patch/content",
  "+components/services/patch/public",
  "+components/services/print_compositor/public",
  "+components/services/quarantine",
  '+components/services/storage/public',
  "+components/services/unzip",
  "+components/session_manager",
  "+components/sessions/content",
  "+components/sessions/core",
  "+components/sharing_message",
  "+components/signin/core/browser",
  "+components/signin/public",
  "+components/site_engagement",
  "+components/site_isolation",
  "+components/soda",
  "+components/spellcheck",
  "+components/sqlite_proto",
  "+components/startup_metric_utils/browser",
  "+components/startup_metric_utils/common",
  "+components/storage_monitor",
  "+components/strings/grit",
  "+components/subresource_filter/android",
  "+components/subresource_filter/content/shared/browser",
  "+components/subresource_filter/content/browser",
  "+components/subresource_filter/content/mojom",
  "+components/subresource_filter/core/browser",
  "+components/subresource_filter/core/common",
  "+components/subresource_filter/core/mojom",
  "+components/supervised_user/core/browser",
  "+components/supervised_user/core/common",
  "+components/supervised_user/test_support",
  "+components/sync",
  "+components/sync_bookmarks",
  "+components/sync_device_info",
  "+components/sync_preferences",
  "+components/sync_sessions",
  "+components/sync_user_events",
  "+components/tab_count_metrics",
  "+components/tab_groups",
  "+components/tpcd/enterprise_reporting",
  "+components/tracing/common",
  "+components/translate/content/android",
  "+components/translate/content/browser",
  "+components/language_detection/content/browser",
  "+components/language_detection/content/common",
  "+components/translate/content/common",
  "+components/translate/core/browser",
  "+components/translate/core/common",
  "+components/translate/core/language_detection",
  "+components/translate/translate_internals",
  "+components/trusted_vault",
  "+components/ui_devtools",
  "+components/ui_metrics",
  "+components/ukm",
  "+components/undo",
  "+components/unexportable_keys",
  "+components/unified_consent",
  "+components/update_client",
  "+components/upload_list",
  "+components/url_matcher",
  "+components/url_pattern_index/proto",
  "+components/user_annotations",
  "+components/user_education",
  "+components/user_manager",
  "+components/user_notes",
  "+components/user_prefs",
  "+components/value_store",
  "+components/vector_icons",
  "+components/version_info",
  "+components/version_ui",
  "+components/visited_url_ranking",
  "+components/viz/common",
  "+components/viz/host",
  "+components/web_cache/browser",
  "+components/web_modal",
  "+components/web_resource",
  "+components/webapps/browser",
  "+components/webapps/common",
  "+components/webauthn",
  "+components/webdata/common",
  "+components/webdata_services",
  "+components/webrtc_logging/browser",
  "+components/webrtc_logging/common",
  "+components/zoom",
  "+content/public/android/java/src/org/chromium/content/browser/webid",
  "+content/public/android/java/src/org/chromium/content_public/browser",
  "+content/public/android/java/src/org/chromium/content_public/common",
  "+content/public/browser",
  "+content/public/common",
  "+device/base",
  "+device/bluetooth",
  "+device/fido",
  "+device/gamepad/public/cpp",
  "+device/vr/buildflags/buildflags.h",
  "+device/vr/public",
  "+extensions/browser",
  "+extensions/common",
  "+extensions/components/javascript_dialog_extensions_client",
  "+extensions/buildflags",
  "+extensions/grit",
  "+extensions/test",
  "+google_apis",
  "+installer_util_strings",  # For generated headers
  "+media/media_buildflags.h",
  "+media/audio", # For media audio hang monitor.
  "+media/base",  # For media switches
  "+media/capabilities", # For InMemoryVideoDecodeStatsDB
  "+media/cdm",
  "+media/gpu/buildflags.h",
  "+media/remoting/device_capability_checker.h",
  "+media/capture",
  "+media/midi",  # For midi switches
  "+media/mojo",  # For mojo media services.
  "+media/renderers",
  "+media/webrtc",  # For webrtc media switches.
  "+mojo/core/embedder",
  "+pdf/pdf_features.h",
  "+ppapi/c",  # For various types.
  "+ppapi/host",
  "+ppapi/proxy",
  "+ppapi/shared_impl",
  "+remoting/host/chromeos/features.h",
  "+rlz",
  "+sandbox/mac",
  "+sandbox/win/src",
  "+services/audio/public",
  "+services/cert_verifier",
  "+services/data_decoder/public",
  "+services/device/public",
  "+services/image_annotation/public",
  "+services/media_session/public",
  "+services/metrics/metrics_mojo_service.h",
  "+services/metrics/public",
  "+services/network/network_service.h",
  "+services/network/public",
  "+services/network/test",
  "+services/network/url_request_context_owner.h",
  "+services/network/url_request_context_builder_mojo.h",
  "+services/on_device_model/public",
  "+services/preferences/public/cpp",
  "+services/preferences/public/mojom",
  "+services/proxy_resolver",  # Android runs the packaged proxy resolver
                               # service in process and needs impl access.
  "+services/proxy_resolver/public/mojom",
  "+services/proxy_resolver_win/public/mojom",
  "+services/resource_coordinator/public/cpp",
  "+services/resource_coordinator/public/mojom",
  "+services/screen_ai",
  "+services/shape_detection/public/mojom",
  "+services/strings",
  "+services/webnn/public/mojom/features.mojom-features.h",
  "+services/tracing/public/cpp",
  "+services/video_capture/public",
  "+services/video_effects/public",
  "+services/video_effects/test",
  "+services/viz/public",
  "+services/viz/privileged",
  "+skia/buildflags.h",
  "+skia/ext",
  "+third_party/boringssl/src/include",
  "+third_party/content_analysis_sdk",
  "+third_party/crashpad",
  "+third_party/cros_system_api",
  "+third_party/metrics_proto",
  "+third_party/omnibox_proto",
  "+third_party/tflite_support",
  "+third_party/widevine/cdm/buildflags.h",
  "+third_party/widevine/cdm/widevine_cdm_common.h",
  "+chrome/services/machine_learning",
  "+chrome/services/speech",

  # Code under //ash should be accessed via its public API. See //ash/README.md.
  "-ash",
  "+ash/components/arc",
  "+ash/constants",
  "+ash/keyboard/ui/grit",
  "+ash/keyboard/ui/resources",
  "+ash/login/ui/management_disclosure_field_trial.h",
  "+ash/public",
  "+ash/webui",

  # The message center should only be accessed through
  # //chrome/browser/notifications.
  "-ui/message_center",
  "+ui/message_center/public",

  # chrome only needs switches and features flags from cc. All usage of the
  # compositor is from content. Definitely don't include generic stuff from
  # cc/base here, if this is needed these files need to move to base/
  "+cc/base/features.h",
  "+cc/base/switches.h",

  # Unsafe to use from //chrome, see http://goo.gl/QQG5wo
  "-content/public/test/test_browser_context.h",

  "+storage/browser",
  "+storage/common",

  # Ensure flags are usable anywhere.
  "+chrome/browser/flags",

  # Ensure that only the public interface of performance_manager gets used.
  "-chrome/browser/performance_manager",
  "+chrome/browser/performance_manager/public",
  "+chrome/browser/performance_manager/test_support",

  # Explicitly disallow using SyncMessageFilter to prevent browser from
  # sending synchronous IPC messages on non-UI threads.
  "-ipc/ipc_sync_message_filter.h",

  # ASK TEXT-TO-SPEECH content/browser/speech/OWNERS BEFORE OVERRIDING THIS IN A
  # SUBDIRECTORY.
  "-content/public/browser/tts_controller.h",

  # Other libraries.
  "+third_party/google_toolbox_for_mac/src",
  "+third_party/icu/source/common/unicode",
  "+third_party/icu/source/i18n/unicode",
  "+third_party/leveldatabase",
  "+third_party/libxml/chromium/xml_writer.h",
  "+third_party/mozilla",     # Mozilla interface headers.
  "+third_party/ocmock/gtest_support.h",
  "+third_party/protobuf/src/google/protobuf",
  "+third_party/re2",
  "+third_party/smhasher",
  "+third_party/zlib",

  # No inclusion of WebKit from the browser, other than the ones in
  # WebKit/public/{mojom,common}.
  # TODO(crbug.com/40649940) clarify dependency and remove or move these individual headers
  # into public/common.
  "-third_party/blink",
  "+third_party/blink/public/common",
  "+third_party/blink/public/mojom",
  "+third_party/blink/public/public_buildflags.h",
]

specific_include_rules = {
  '.*Test\.java': [
    # Android instrumentation tests depend on the whole app.
    "+chrome/android",
    "+chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java",
    "+chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java",
  ],
  '.*TestUtils\.java': [
      "+chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java",
      "+chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java",
    ],
  "platform_util_ash\.cc": [
    "+ash/wm/window_pin_util.h",
  ],
  "platform_util_linux.cc": [
    # The following is used to call the org.freedesktop.FileManager1
    # DBus interface to highlight a file within its parent folder
    "+dbus"
  ],
  "exo_parts\.cc": [
    "+ash/shell.h",
  ],
  # TODO(estade): the message center is initialized and shut down here, but it
  # should be the responsibility of code in chrome/browser/notifications/
  "browser_process_impl.cc": [
    "+ui/message_center/message_center.h",
  ],
  "input_method_engine.cc": [
    # For GetVirtualKeyboardController.
    "+ash/keyboard/ui/keyboard_ui_controller.h",
  ],
  "chrome_browsing_data_remover_delegate_unittest.cc": [
    "+services/network/network_context.h",
    "+services/network/network_service.h",
  ],
  "bound_session_cookie_observer_unittest\.cc": [
    "+services/network/cookie_manager.h",
    "+services/network/network_context.h",
    "+services/network/network_service.h",
  ],
  "chrome_authenticator_request_delegate_unittest\.cc": [
    "+third_party/microsoft_webauthn/webauthn.h",
  ],
  "chrome_content_browser_client_receiver_bindings\.cc" : [
    "+chrome/browser/performance_manager/mechanisms/userspace_swap_chromeos.h",
  ],
  "chrome_content_browser_client\.cc" : [
    "+content/public/browser/tts_controller.h",
  ],
  "chrome_navigation_browsertest.cc" : [
    "+content/common/content_navigation_policy.h",
  ],
  "about_flags\.cc" : [
    "+mojo/core/embedder/features.h",
    "+sandbox/policy/features.h",
    "+skia/rusty_png_feature.h",
  ],
  "dbus_memory_pressure_evaluator_linux(_unittest)?\.(cc|h)" : [
    "+dbus",
  ],
  "permission_element_browsertest.cc": [
    "+chrome/browser/ui/views/permissions/embedded_permission_prompt_content_scrim_view.h",
  ],
  "browsing_data_model_browsertest.cc" : [
    "+components/services/storage/shared_storage/shared_storage_manager.h",
  ],
  "ash_session_restore_page_load_metrics_observer_browsertest\.cc": [
    "+ash/wm/window_restore/window_restore_util.h",
  ],
  "render_view_context_menu_browsertest.cc" : [
    "+ash/wm/window_pin_util.h",
    "+third_party/libwebp/src/src/webp/decode.h",
  ],
  "webauth_interactive_uitest.cc": [
    "+device/fido",
  ],
  "shared_storage_browsertest.cc": [
    "+components/services/storage/shared_storage/shared_storage_manager.h",
  ],
  "certificate_manager_model.cc": [
    "+ash/components/kcer",
  ],
  "certificate_manager_model_unittest.cc": [
    "+ash/components/kcer/extra_instances.h",
  ],
}
